﻿

//双击事件
var CustomDbClick = function () {//屏蔽双击事件
    parent.closeWin();
}

//保存选取的应聘人
function Save() {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请至少选择一条记录!");
        return;
    }
    var CandidateInfo = [];
    CandidateInfo[0] = record.getData("PlanName");
    CandidateInfo[1] = record.getData("PostName");
    CandidateInfo[2] = record.getData("Name");
    CandidateInfo[3] = record.getData("IDCardNo");
    CandidateInfo[4] = record.getData("ID");
    parent.dialogCandidateInfo.hide();
    parent.SaveCandidateInfo(CandidateInfo);
}

//页面加载时
if (typeof ($) != "undefined") {
    $(document).ready(function () {
//        var obj = parent.document.getElementById("yui-gen15-button");
//        obj.setAttribute("mousedown", "Save();");
    });
}

//点击"简历"按钮后触发,查看原始简历信息
var fnBrowseResume = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    else {
        var id = record.getData(const_entityID);
        YAHOO.util.Connect.asyncRequest('POST', "../EHR/hrAjax.aspx?flag=getresume&id=" + id, {
            success: function (res) {
                try {
                    var str = res.responseText;
                    if (str != "-1") {
                        var CName = record.getData("Name");
                        var pagetitle = "简历信息——" + CName;
                        parent.parent.addTabs(pagetitle, "../EHR/tempfiles/" + str);
                        parent.parent.NeedRefreshPage = this;
                        //window.open("../EHR/upload/tempresume.htm"); 
                        //window.open("../EHR/upload/tempresume.htm", "newwindow", "modal=yes,width=800,height=600,resizable=no,scrollbars=no,location=no,menubar=no,alwaysRaised=yes");
                        //                        document.getElementById("dialog5_h").innerHTML = record.getData("CandidateName") + "简历";
                        //                        document.getElementById("EditUIWindow3").src = "../EHR/upload/tempresume.htm";
                        //                        SetDWH(800, 600, YAHOO.example.container.dialog5);
                        //                        YAHOO.example.container.dialog5.show();
                        //暂时用模态窗口
                        //window.showModalDialog("../EHR/tempfiles/" + str, window, "dialogWidth=" + window.screen.width + "px;dialogHeight=" + window.screen.height + "px;status=no;help=no;scroll=yes;resizable=yes");
                    }
                    else {
                        alert("获取简历失败！");
                    }
                }
                catch (e) {
                }
                finally {
                }
            },
            failure: function (error) {
                alert("数据错误：" + error.statusText);
            }
        }, null);
    }
}